USE [wdms]
GO

-- =============================================
-- Author     :		Lohith Ram D V
-- Create date:         08/mar/2011
-- Description:	Delete a document by title.
-- =============================================

create procedure sp_DeleteDocumentByTitle( 
	@par_title varchar(50),
	@user_id int)
AS
BEGIN
	DECLARE @doc_id int
	
	SELECT @doc_id = (SELECT [Document].[doc_id]
	FROM [Document]
	WHERE [Document].[doc_title]=@par_title AND [Document].[user1_id]=@user_id)
	
	EXEC sp_DeleteDocumentByID @doc_id;
END

